Subtyping for mutable types in object-oriented programming languages
نویسندگان
چکیده
Subtype relationships in object-oriented programming languages are studied to aid code reuse and reasoning about programs that use subtype polymorphism. We de ne what it means for one abstract data type to be a subtype of another. This de nition allows for both mutation and aliasing. This work gives intuition for programmers and guidance to language designers.
منابع مشابه
Semantic subtyping between coinductive mutable record types with unions and intersections
Semantic subtyping between coinductive record types supports accurate type analysis of object-oriented languages, by introducing Boolean type constructors and modeling cyclic objects. In previous work, a sound and complete algorithm for semantic subtyping has been proposed, but only for coinductive immutable record types with unions. In this work we address the issue of extending the previous r...
متن کاملBehavioral Subtyping is Equivalent to Modular Reasoning for Object-oriented Programs
Behavioral subtyping is an established idea that enables modular reasoning about behavioral properties of object-oriented programs. It requires that syntactic subtypes are behavioral refinements. It validates reasoning about a dynamically-dispatched method call, say E .m(), using the specification associated with the static type of the receiver expression E . For languages with references and m...
متن کاملObject Ownership and Containment
Object-oriented programming relies on inter-object aliases to implement data structures and other abstractions. Objects have mutable state, but it is when mutable state interacts with aliasing that problems arise. Through aliasing an object’s state can be changed without the object being aware of the changes, potentially violating the object’s invariants. This problem is fundamentally unresolva...
متن کاملInheritance-Based Subtyping
Classes play a dual rôle in mainstream statically-typed object-oriented languages, serving as both object generators and object types. In such languages, inheritance implies subtyping. In contrast, the theoretical language community has viewed this linkage as a mistake and has focused on subtyping relationships determined by the structure of object types, without regard to their underlying impl...
متن کاملFrom F to DOT: Type Soundness Proofs with Definitional Interpreters
Scala’s type system unifies aspects of ML modules, object-oriented, and functional programming. The Dependent Object Types (DOT) family of calculi has been proposed as a new theoretic foundation for Scala and similar expressive languages. Unfortunately, it is not clear how DOT relates to well-studied type systems from the literature, and type soundness has only been established for very restric...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 1992